package com.example.administrator.x2picturetransliteration.View;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.ListView;

/**
 * 重写的一个ListView，禁止了它的滑动功能，防止与ScrollView之间冲突
 * 2018/5/17.
 */

public class NonSlidingListView extends ListView{
    public NonSlidingListView(Context context) {
        super(context);
    }

    public NonSlidingListView(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public NonSlidingListView(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
    }

    @Override
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {

        int mExpandSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2, MeasureSpec.AT_MOST);

        super.onMeasure(widthMeasureSpec, mExpandSpec);
    }
}